package com.woniu.service.productcommand;

import com.woniu.util.ApplicationContextHolder;
import lombok.Data;

/**
 * @description:
 * @author: my
 * @time: 2021/5/8 14:42
 */
@Data
public class ProductManageCommand {
    private ProductManageCommandHandler handler;
    private Integer id;

    public ProductManageCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(ProductManageCommandHandler.class);
    }

    public ProductManageCommand(Integer id){
        this();
        this.id = id;
    }

    public void execute(){
        this.handler.action(this);
    }
}
